﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using PersonalWebsite.Domain.Abstract.Configuration;
using PersonalWebsite.Domain.Entities.Website;

namespace PersonalWebsite.Domain.Configurations.Website;

public class WS_TgaGameConfiguration : BaseConfiguration<WS_TgaGame>
{
    public override void Configure(EntityTypeBuilder<WS_TgaGame> builder)
    {
        builder.ToTable(nameof(WS_TgaGame));

        builder.Property(c => c.Name).HasComment(comment: "名称").IsRequired().HasMaxLength(20);
        builder.Property(c => c.Country).HasComment("国家").HasMaxLength(10);
        builder.Property(c => c.Desc).HasComment("描述").HasMaxLength(1000).IsRequired(true);
        builder.Property(c => c.AwardTime).HasComment("获奖时间").IsRequired(true);
        builder.Property(c => c.PublishTime).HasComment("发布时间").IsRequired(true);
        builder.Property(c => c.Cover).IsUnicode(false).HasComment("封面").IsRequired().HasMaxLength(1000);
        builder.Property(c => c.Video).IsUnicode(false).HasComment("宣传片链接").IsRequired(false);


        base.Configure(builder);
    }
}